import { ExtensionContext, workspace } from 'vscode';
import { installCommands } from './commands';
import { GlobalConst } from './constants';
import { PreviewSystemProvider } from './file-system';
import { ctx } from './global';

/**
 * 插件激活
 *
 * @author chitanda
 * @date 2022-01-18 11:01:41
 * @export
 * @param {ExtensionContext} context
 */
export function activate(context: ExtensionContext) {
  installCommands();
  const fs = new PreviewSystemProvider();
  context.subscriptions.push(workspace.registerFileSystemProvider(GlobalConst.PREVIEW_SYSTEM_SCHEME, fs, { isCaseSensitive: true }));
  ctx.setFs(fs);
}

/**
 * 插件销毁
 *
 * @author chitanda
 * @date 2022-01-18 11:01:47
 * @export
 */
export function deactivate() {}
